package com.mtsmda.chapter2.constructorsEx;

public class AnimalC {

	private String animalName;

	public AnimalC(String animalName) {
		this.animalName = animalName;
	}

	public AnimalC() {
		this(randomSetAnimalName());
	}

	static String randomSetAnimalName() {
		int index = (int) (Math.random() * 5);
		String name = new String[] { "Bobik", "Murzik", "Mishka", "Barsik",
				"Fleshka" }[index];
		return name;
	}

	public String getAnimalName() {
		return animalName;
	}

}